package com.wd.mylibrary_live.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.wd.mylibrary_base.bean.MusicBean
import com.wd.mylibrary_base.utils.HttpUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 * 作者: 邢凌志
 * 时间: 2024/9/27
 * 描述:
 */
class MusicViewModel :ViewModel() {
    var musicData=MutableLiveData<MusicBean>()
    fun getMusicData(page:Int,size:Int){
        HttpUtils.httpUtils.apiService2.getMusicBean(page, size)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe {
                musicData.value=it
            }
    }
}